package com.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entity.Carpool;
import com.entity.Help;
import com.entity.UserInfo;
import com.mapper.HelpMapper;

@Service
public class HelpService {
	@Autowired
	HelpMapper helpMapper;
	
	/**插入求助*/
    public Integer insertHelp(Help help) {
    	return helpMapper.insertHelp(help);
    }
    /**查询求助记录 */
	public List<Help> lookHelp(UserInfo user){
   		return helpMapper.lookHelp(user);
   	}
	/**查询某一类型记录 */ 
	public List<Help> lookTepyHelp(String type){
   		return helpMapper.lookTepyHelp(type);
   	}
	/**查询一条求助记录 */
	public Help lookIdHelp(Integer help_id) {
		return helpMapper.lookIdHelp(help_id);
	}
	/**修改一条具体的求助记录*/
	public Integer updateHelp(Help help) {
		return helpMapper.updateHelp(help);
	}
	/**修改一条具体的求助记录*/
	public Integer updateFlagHelp(Help help) {
		return helpMapper.updateFlagHelp(help);
	}
	/**删除一条具体的求助记录*/
	public Integer deleteHelp(Integer help_id) {
		return helpMapper.deleteHelp(help_id);
	}
	
	/**查询以过求助*/
    public Integer LookHelpCount() {
    	return helpMapper.LookHelpCount();
    }
    /**查询以过求助总数 */
   	public List<Help> queryAllHelps(int limit, int page){
   		return helpMapper.queryAllHelps(limit, page);
   	}
   	/**查询未过求助*/
    public Integer LookUnHelpCount() {
    	return helpMapper.LookUnHelpCount();
    }
    /**查询未过求助总数 */
   	public List<Help> queryAllUnHelps(int limit, int page){
   		return helpMapper.queryAllUnHelps(limit, page);
   	}
   	
}
